const g = getApp().globalData
const util = g.util

Page({


    data: {
        logList: []
    },

    onLoad: function (options) {
        this.id = options.id
        this.date = options.date
        this.name = options.name
        this.getOperateLog()
        wx.setNavigationBarTitle({
            title: `${this.name}操作日志`,
        })
    },

    onPullDownRefresh(){
        wx.stopPullDownRefresh()
        this.getOperateLog()
    },

    //获取操作日志
    getOperateLog() {
        let url = `switchs/switchLog?id=${this.id}&date=${this.date}`
        util.httpGet({
            url: url,
            header: { authorization: g.userInfo.token },
            fn: res => {
                let logList = res.data.result
                this.setData({
                    logList
                })
            }
        })
    },

})